package com.child.util;

import java.awt.Toolkit;

import javax.swing.JFrame;

public class MyChildChess extends JFrame {
	public  MyChildChess(){
		this.setTitle("我的窗体");
		this.setSize(300, 200);
		this.setResizable(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//关闭窗体时同时结束程序
		//得到屏幕大小，使屏幕居中
		int width=Toolkit.getDefaultToolkit().getScreenSize().width;
		int height=Toolkit.getDefaultToolkit().getScreenSize().height;
		this.setLocation((width-300)/2, (height-200)/2);
		this.setVisible(true);
	}
}
